//
//  ViewController.h
//  itaka
//
//  Created by Robert Soszynski on 1/11/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol SignDelegate <NSObject>
@required
- (void) signInButtonPressed: (NSString*) username: (NSString*) password: (NSString*) domain;
- (void) signOutButtonPressed;
@end

@interface ViewController : UIViewController {
    id <SignDelegate> delegate;
    
    IBOutlet UITextField *mUsernameField;
    IBOutlet UILabel *mDomain;
    IBOutlet UITextField *mPasswordField;
    IBOutlet UIActivityIndicatorView *mActivityIndicator;
    IBOutlet UIBarButtonItem *mSignIn;
    IBOutlet UIBarButtonItem *mSignOut;
    IBOutlet UILabel *mSignInInfo;
    IBOutlet UILabel *mSignInLogin;
    
    enum views { START_VIEW, LOADING_VIEW, SIGNED_VIEW };
}

@property (retain, nonatomic) id <SignDelegate> delegate;

- (IBAction) signIn;
- (IBAction) signOut;
- (void) changeView: (enum views) view;
- (IBAction) textFieldReturn:(id)sender;
- (IBAction) backgroundTouched:(id)sender;

- (void) signingCompleted: (NSString*) login;
- (void) signingFailed;

@end
